package model.pojo;
// Generated Sep 3, 2012 11:51:00 PM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PhieuNhap generated by hbm2java
 */
@Entity
@Table(name="phieu_nhap"
    ,schema="public"
)
public class PhieuNhap  implements java.io.Serializable {


     private int maPhieuNhap;
     private TinhTrangPn tinhTrangPn;
     private NhanVien nhanVien;
     private Date ngayNhap;
     private Double tongTien;
     private String idPhieuNhap;
     private Set<ChiTietPn> chiTietPns = new HashSet<ChiTietPn>(0);

    public PhieuNhap() {
    }

	
    public PhieuNhap(int maPhieuNhap) {
        this.maPhieuNhap = maPhieuNhap;
    }
    public PhieuNhap(int maPhieuNhap, TinhTrangPn tinhTrangPn, NhanVien nhanVien, Date ngayNhap, Double tongTien, String idPhieuNhap, Set<ChiTietPn> chiTietPns) {
       this.maPhieuNhap = maPhieuNhap;
       this.tinhTrangPn = tinhTrangPn;
       this.nhanVien = nhanVien;
       this.ngayNhap = ngayNhap;
       this.tongTien = tongTien;
       this.idPhieuNhap = idPhieuNhap;
       this.chiTietPns = chiTietPns;
    }
   
     @Id 
    
    @Column(name="ma_phieu_nhap", unique=true, nullable=false)
    public int getMaPhieuNhap() {
        return this.maPhieuNhap;
    }
    
    public void setMaPhieuNhap(int maPhieuNhap) {
        this.maPhieuNhap = maPhieuNhap;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ma_tinh_trang_pn")
    public TinhTrangPn getTinhTrangPn() {
        return this.tinhTrangPn;
    }
    
    public void setTinhTrangPn(TinhTrangPn tinhTrangPn) {
        this.tinhTrangPn = tinhTrangPn;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ma_nhan_vien")
    public NhanVien getNhanVien() {
        return this.nhanVien;
    }
    
    public void setNhanVien(NhanVien nhanVien) {
        this.nhanVien = nhanVien;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="ngay_nhap", length=29)
    public Date getNgayNhap() {
        return this.ngayNhap;
    }
    
    public void setNgayNhap(Date ngayNhap) {
        this.ngayNhap = ngayNhap;
    }
    
    @Column(name="tong_tien", precision=17, scale=17)
    public Double getTongTien() {
        return this.tongTien;
    }
    
    public void setTongTien(Double tongTien) {
        this.tongTien = tongTien;
    }
    
    @Column(name="id_phieu_nhap", length=6)
    public String getIdPhieuNhap() {
        return this.idPhieuNhap;
    }
    
    public void setIdPhieuNhap(String idPhieuNhap) {
        this.idPhieuNhap = idPhieuNhap;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="phieuNhap")
    public Set<ChiTietPn> getChiTietPns() {
        return this.chiTietPns;
    }
    
    public void setChiTietPns(Set<ChiTietPn> chiTietPns) {
        this.chiTietPns = chiTietPns;
    }




}


